import requests
class RegisterApi:
    @classmethod
    def get_cod(cls,session):
        session.get(url="http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=verify")
    @classmethod
    def longin_tp(cls,session,data_json):
        resp = session.post(url="http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=do_login", data=data_json)
        return resp

if __name__ == '__main__':
    session=requests.session()
    RegisterApi.get_cod(session)
    data_json = {"username": "13800000002", "password": "123456","verify_code": "8888"}
    r=RegisterApi.longin_tp(session,data_json)
    print(r.json())




